package com.github.jcooky.structure;

public class NodeListDeque implements Deque {
	private NodeList list;
	
	public NodeListDeque(NodeList list) {
		this.list = list;
	}

	public void addFirst(Object o) {
		list.addFirst(o);
	}

	public void addLast(Object o) {
		list.addLast(o);
	}

	public Object removeFirst() {
		return list.remove(list.first());
	}

	public Object removeLast() {
		return list.remove(list.last());
	}

	public Object getFirst() {
		return list.first().element();
	}

	public Object getLast() {
		return list.last().element();
	}

	public int size() {
		return list.size();
	}

	public boolean isEmpty() {
		return list.isEmpty();
	}

	public Iterator iterator() {
		return list.iterator();
	}
}
